package com.cloudfun.campusshare.service;

import com.cloudfun.campusshare.common.model.dto.PromotionDTO;
import com.cloudfun.campusshare.common.model.dto.PromotionModifyDTO;
import com.cloudfun.campusshare.common.model.dto.PromotionSearchDTO;
import com.cloudfun.campusshare.common.model.dto.SamePeriodPromotionSearchDTO;
import com.cloudfun.campusshare.common.model.vo.PromotionDetailVO;
import com.cloudfun.campusshare.common.model.vo.PromotionListVO;
import com.cloudfun.campusshare.common.response.PageResult;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Created by CodeGenerator on 2020/06/06
 */
public interface PromotionService {

    /**
     * 创建
     *
     * @param createDTO
     */
    <T extends PromotionDTO> void create(T createDTO);

    /**
     * 查询同一时间段内，所选洗衣点同类型的活动
     *
     * @param searchDTO
     * @return
     */
    List<PromotionListVO> samePeriodPromotionList(SamePeriodPromotionSearchDTO searchDTO);

    /**
     * 分页搜索
     *
     * @param searchDTO
     * @param pageable
     * @return
     */
    PageResult<PromotionListVO> search(PromotionSearchDTO searchDTO, Pageable pageable);

    /**
     * 修改
     *
     * @param promotionDTO
     */
    void modify(PromotionModifyDTO promotionDTO);

    /**
     * 删除
     *
     * @param id
     */
    void delete(String id);

    /**
     * 批量下线
     *
     * @param ids
     */
    void offline(List<String> ids);

    /**
     * 批量下线
     *
     * @param searchDTO
     */
    void offline(PromotionSearchDTO searchDTO);

    /**
     * 批量下线
     */
    void offlineAll();

    /**
     * 详情
     *
     * @param id
     * @return
     */
    PromotionDetailVO detail(String id);

    /**
     * 列表
     *
     * @param searchDTO
     * @return
     */
    List<PromotionDetailVO> list(PromotionSearchDTO searchDTO);

    /**
     * 用户领取代金券
     *
     * @param id
     */
    void drawCoupon(String id);

    /**
     * 自动变更状态
     */
    void autoChangeStatus();
}